<template>
  <div class="moneyDetail">
    <div class="bt_box">
      <p class="btText">子商户进件状态</p>
    </div>
    <div class="information" style="display: block">
      <div class="list_box" v-if="fundAccountSettleType==1">
        <div class="list" style="width: auto">
          <div class="lable">日常消费账户进件状态:</div>
          <div class="text" style="width: auto">{{ entryStatusInfo.everydayEntryStatusDict }}</div>
          <div class="flex">
            <el-button type="primary" size="mini" style="margin-left: 10px"
              v-if="entryStatusInfo.everydayEntryStatus=='AUDITED'"
              @click="settleInfoDialogShow(entryStatusInfo.everydayFundAccountId,1,entryStatusInfo.everydayChangeSettleStatus)">
              结算信息变更<span v-if="entryStatusInfo.everydayChangeSettleStatus!=''">（<span
                  v-if="entryStatusInfo.everydayChangeSettleStatus==1">审核中</span><span
                  v-if="entryStatusInfo.everydayChangeSettleStatus==3">失败</span>）</span></el-button>
            <el-button type="primary" size="mini" style="margin-left: 10px"
              v-if="entryStatusInfo.everydayEntryStatus=='AUDITED'"
              @click="rateInforDialogShow(entryStatusInfo.everydayFundAccountId,1,entryStatusInfo.everydayChangeFeeStatus)">
              费率信息变更<span v-if="entryStatusInfo.everydayChangeFeeStatus!=''">（<span
                  v-if="entryStatusInfo.everydayChangeFeeStatus==1">审核中</span><span
                  v-if="entryStatusInfo.everydayChangeFeeStatus==3">失败</span>）</span>
            </el-button>
          </div>
        </div>
        <div class="list">
          <div class="lable">失败原因:</div>
          <div class="text">{{ entryStatusInfo.everydayRemark }}</div>
        </div>
      </div>
      <div class="list_box" v-if="fundAccountSettleType==2">
        <div class="list" style="width: auto">
          <div class="lable">存管账户进件状态:</div>
          <div class="text" style="width: auto">{{ entryStatusInfo.depositEntryStatusDict }}</div>
          <div class="flex">
            <el-button type="primary" size="mini" style="margin-left: 10px"
              v-if="entryStatusInfo.depositEntryStatus=='AUDITED'"
              @click="settleInfoDialogShow(entryStatusInfo.depositFundAccountId,2,entryStatusInfo.depositChangeSettleStatus)">
              结算信息变更<span v-if="entryStatusInfo.depositChangeSettleStatus!=''">（<span
                  v-if="entryStatusInfo.depositChangeSettleStatus==1">审核中</span><span
                  v-if="entryStatusInfo.depositChangeSettleStatus==3">失败</span>）</span></el-button>
            <el-button type="primary" size="mini" style="margin-left: 10px"
              v-if="entryStatusInfo.depositEntryStatus=='AUDITED'"
              @click="rateInforDialogShow(entryStatusInfo.depositFundAccountId,2,entryStatusInfo.depositChangeFeeStatus)">
              费率信息变更<span v-if="entryStatusInfo.depositChangeFeeStatus!=''">（<span
                  v-if="entryStatusInfo.depositChangeFeeStatus==1">审核中</span><span
                  v-if="entryStatusInfo.depositChangeFeeStatus==3">失败</span>）</span>
            </el-button>
          </div>
        </div>
        <div class="list">
          <div class="lable">失败原因:</div>
          <div class="text">{{ entryStatusInfo.depositRemark }}</div>
        </div>
      </div>
      <div class="list" style="width: auto;" v-if="entryStatusInfo.everydayEntryStatus=='WAIT_SIGN'||entryStatusInfo.depositEntryStatus=='WAIT_SIGN'">
        <span class="lable" style="width: auto;">签约链接：</span>
        <span class="text" style="width: auto;">{{signUrl}}</span>
        <el-button type="primary" size="mini" @click="getYishengSignApply" :loading="signLoading" v-if="signUrl==''">获取签约链接</el-button>
        <span class="el-icon-copy-document copy_icon" v-clipboard:copy="signUrl" v-clipboard:success="onCopy" v-if="signUrl!=''"></span>
      </div>
    </div>
    <div class="bt_box">
      <p class="btText">子商户进件基本资料</p>
      <template v-if="pathType != 'merchantsDetail'">
        <div>
          <el-button size="" type="primary" @click="basicModify" v-if="
          !basicModifyshow &&
          entryStatusInfo.everydayEntryStatusDict != '审核通过' &&
          entryStatusInfo.depositEntryStatusDict != '审核通过'
        ">修改信息</el-button>
        </div>
        <div>
          <el-button size="" type="warning" @click="basicSumit" v-if="basicModifyshow" :loading="basicLoading">保存
          </el-button>
          <el-button size="" type="" @click="cancellationBasicModifyshow" v-if="basicModifyshow">取消</el-button>
        </div>
      </template>

    </div>
    <div class="information">
      <div class="list">
        <div class="lable">支付公司:</div>
        <div class="text">易生</div>
      </div>
      <div class="list">
        <div class="lable">子商户类型:</div>
        <div class="text" v-if="!basicModifyshow">
          {{ data.merchantTypeDict }}
        </div>
        <div class="txt" v-if="basicModifyshow">
          <el-select v-model="fromBase.merchantType" placeholder="请选择">
            <el-option v-for="item in options" :key="item.id" :label="item.value" :value="item.id">
            </el-option>
          </el-select>
        </div>
      </div>
      <div class="list">
        <div class="lable">企业名称:</div>
        <div class="text" v-if="!basicModifyshow">
          {{ data.businessLicence }}
        </div>
        <div v-if="basicModifyshow">
          <el-input v-model="fromBase.businessLicence" placeholder="请输入"></el-input>
        </div>
      </div>
      <div class="list">
        <div class="lable">统一社会信用代码:</div>
        <div class="text" v-if="!basicModifyshow">
          {{ data.businessLicenceNo }}
        </div>
        <div v-if="basicModifyshow">
          <el-input v-model="fromBase.businessLicenceNo" placeholder="请输入"></el-input>
        </div>
      </div>
      <div class="list">
        <div class="lable">企业成立日期:</div>
        <div class="text" v-if="!basicModifyshow">
          {{ data.businessLicenceSdate }}
        </div>
        <div v-if="basicModifyshow">
          <!-- <el-input
            v-model="fromBase.businessLicenceSdate"
            placeholder="请输入"
          ></el-input> -->
          <el-date-picker v-model="fromBase.businessLicenceSdate" type="date" placeholder="选择日期" format="yyyy.MM.dd"
            value-format="yyyy.MM.dd" :clearable="false">
          </el-date-picker>
        </div>
      </div>
      <div class="list">
        <div class="lable">经营期限:</div>
        <div class="text" v-if="!basicModifyshow">
          {{ data.businessLicenceEdate }}
        </div>
        <div v-if="basicModifyshow">
          <!-- <el-input
            v-model="fromBase.businessLicenceEdate"
            placeholder="请输入"
          ></el-input> -->
          <el-radio-group v-model="radio" @change="changeRadio">
            <el-radio :label="1">
              <el-date-picker v-model="qxDate" type="date" placeholder="选择日期" :clearable="false"
                value-format="yyyy-MM-dd" :disabled="pickDisabled" @change="changeDate">
              </el-date-picker>
            </el-radio>
            <el-radio :label="2" style="margin-top: 10px">长期</el-radio>
          </el-radio-group>
        </div>
      </div>
      <div class="list">
        <div class="lable">法人名字:</div>
        <div class="text" v-if="!basicModifyshow">
          {{ data.legalPersonName }}
        </div>
        <div v-if="basicModifyshow">
          <el-input v-model="fromBase.legalPersonName" placeholder="请输入"></el-input>
        </div>
      </div>
      <div class="list">
        <div class="lable">法人身份证号:</div>
        <div class="text" v-if="!basicModifyshow">{{ data.legalPersonId }}</div>
        <div v-if="basicModifyshow">
          <el-input v-model="fromBase.legalPersonId" placeholder="请输入"></el-input>
        </div>
      </div>
      <div class="list">
        <div class="lable">法人证件类型:</div>
        <div class="text">身份证</div>
      </div>
      <div class="list">
        <div class="lable">法人身份证开始日期:</div>
        <div class="text" v-if="!basicModifyshow">
          {{ data.legalPersonIdSdate }}
        </div>
        <div v-if="basicModifyshow">
          <!-- <el-input
            v-model="fromBase.legalPersonIdSdate"
            placeholder="请输入"
          ></el-input> -->
          <el-date-picker v-model="fromBase.legalPersonIdSdate" type="date" format="yyyy.MM.dd"
            value-format="yyyy.MM.dd" placeholder="选择日期" :clearable="false">
          </el-date-picker>
        </div>
      </div>
      <div class="list">
        <div class="lable">法人身份证结束日期:</div>
        <div class="text" v-if="!data.idCardValidType && !basicModifyshow">
          {{ data.legalPersonIdEdate }}
        </div>
        <div class="text" v-if="data.idCardValidType && !basicModifyshow">
          长期有效
        </div>
        <div v-if="basicModifyshow">
          <!-- <el-input
            v-model="fromBase.legalPersonIdEdate"
            placeholder="请输入"
          ></el-input> -->
          <el-date-picker v-model="fromBase.legalPersonIdEdate" type="date" format="yyyy.MM.dd"
            value-format="yyyy.MM.dd" placeholder="选择日期" :clearable="false">
          </el-date-picker>
        </div>
      </div>
      <div class="list">
        <div class="lable">法人联系电话:</div>
        <div class="text" v-if="!basicModifyshow">
          {{ data.phone }}
        </div>
        <div v-if="basicModifyshow">
          <el-input v-model="fromBase.phone" placeholder="请输入"></el-input>
        </div>
      </div>
      <div class="list">
        <div class="lable">注册地址:</div>
        <div class="text" v-if="!basicModifyshow">
          {{ data.registeredAddress }}
        </div>
        <div v-if="basicModifyshow">
          <el-input v-model="fromBase.registeredAddress" placeholder="请输入"></el-input>
        </div>
      </div>
      <!-- <div class="list">
        <div class="lable">店铺类型:</div>
        <div class="text" v-if="!basicModifyshow">
          {{ data.shopTypeParentName }} 》{{ data.shopTypeName }}
        </div>
        <el-cascader v-model="avalue" :options="typeLs" :show-all-levels="true" @change="handleChange"
          v-if="basicModifyshow"></el-cascader>
      </div> -->
      <div class="list">
        <div class="lable">店铺名称:</div>
        <div class="text" v-if="!basicModifyshow">{{ data.shopName }}</div>
        <div v-if="basicModifyshow">
          <el-input v-model="fromBase.shopName" placeholder="请输入"></el-input>
        </div>
      </div>
      <div class="list">
        <div class="lable">是否完成电子签章:</div>
        <div class="text">否</div>
      </div>
      <div class="list">
        <div class="lable">营业地区:</div>
        <div class="text" v-if="!basicModifyshow">{{ data.mercName }}</div>
        <div v-if="basicModifyshow">
          <el-cascader :options="regionOptions" :props="{ value: 'id',label: 'label',children: 'children'}" filterable
            @change="regionChange" v-model="regionAvalue">
          </el-cascader>
        </div>
      </div>
      <div class="list">
        <div class="lable">行业MCC:</div>
        <div class="text" v-if="!basicModifyshow">
          {{ data.mccCdName }}
        </div>
        <div class="txt" v-if="basicModifyshow">
          <el-select v-model="fromBase.mccCd" placeholder="请选择" filterable>
            <el-option v-for="item in ysMccList" :key="item.id" :label="item.value" :value="item.id">
            </el-option>
          </el-select>
        </div>
      </div>
      <div class="list">
        <div class="lable">营业形态:</div>
        <div class="text" v-if="!basicModifyshow">
          <dict-tag :options="businessModel" :value="fromBase.businForm" />
        </div>
        <div class="txt" v-if="basicModifyshow">
          <el-select v-model="fromBase.businForm" placeholder="请选择">
            <el-option v-for="item in businessModel" :key="item.id" :label="item.value" :value="item.id">
            </el-option>
          </el-select>
        </div>
      </div>
      <div class="list">
        <div class="lable">注册资本:</div>
        <div class="text" v-if="!basicModifyshow">
          {{ data.capital }}
        </div>
        <div v-if="basicModifyshow">
          <el-input v-model="fromBase.capital" placeholder="请输入"><template slot="append">万元</template></el-input>
        </div>
      </div>
      <div class="list">
        <div class="lable">公司规模:</div>
        <div class="text" v-if="!basicModifyshow">
          <dict-tag :options="scaleOptions" :value="fromBase.employeeNum" />
        </div>
        <div class="txt" v-if="basicModifyshow">
          <el-select v-model="fromBase.employeeNum" placeholder="请选择">
            <el-option v-for="item in scaleOptions" :key="item.id" :label="item.value" :value="item.id">
            </el-option>
          </el-select>
        </div>
      </div>
      <div class="list">
        <div class="lable">主营业务:</div>
        <div class="text" v-if="!basicModifyshow">
          {{ data.businScope }}
        </div>
        <div v-if="basicModifyshow">
          <el-input v-model="fromBase.businScope" placeholder="请输入" type="textarea" :rows="6" maxlength="500" show-word-limit></el-input>
        </div>
      </div>
    </div>
    <!-- 日常消费结算账户资料 -->
    <template v-if="fundAccountSettleType==1">
      <div class="bt_box">
        <p class="btText">日常消费结算账户资料</p>
        <template v-if="pathType != 'merchantsDetail'">
          <div>
            <el-button size="" type="primary" @click="settlementMide" v-if="
          !settlementShow &&
          entryStatusInfo.everydayEntryStatusDict != '审核通过'
        ">修改信息</el-button>
          </div>
          <div>
            <el-button size="" type="warning" @click="settlementSumit" v-if="settlementShow" :loading="settleLoading">保存
            </el-button>
            <el-button size="" type="" @click="cancelSettlementShow" v-if="settlementShow">取消</el-button>
          </div>
        </template>
      </div>
      <div class="information" v-loading="viewLoading" element-loading-text="支行加载中"
        element-loading-spinner="el-icon-loading">
        <div class="list">
          <div class="lable">结算方式:</div>
          <div class="text" v-if="!settlementShow">
            {{ settleInfo.settleBankTypeDict }}
          </div>
          <div class="txt" v-if="settlementShow">
            <el-select v-model="fromSettle.settleBankType" placeholder="请选择">
              <el-option v-for="item in options2" :key="item.id" :label="item.value" :value="item.id">
              </el-option>
            </el-select>
          </div>
        </div>
        <div class="list">
          <div class="lable">结算费率:</div>
          <div class="text" v-if="!settlementShow">{{ settleInfo.fee }}</div>
          <div v-if="settlementShow">
            <el-input v-model="fromSettle.fee" placeholder="请输入" :style="{width: inputWidth}"></el-input>
          </div>
        </div>
        <div class="list">
          <div class="lable">结算银行卡号:</div>
          <div class="text" v-if="!settlementShow">
            {{ settleInfo.balanceAccCardno }}
          </div>
          <div v-if="settlementShow">
            <el-input v-model="fromSettle.balanceAccCardno" placeholder="请输入" :style="{width: inputWidth,paddingRight:'10px'}" ></el-input>
            <el-button size="small" type="primary" @click="openingBank(fromSettle.balanceAccCardno)">查询匹配开户行</el-button>
          </div>
        </div>
        <div class="list">
          <div class="lable">开户行名称:</div>
          <div class="text" v-if="!settlementShow">{{ settleInfo.bankName }}</div>
          <div class="txt flex" v-if="settlementShow">
            <!-- <el-select v-model="fromSettle.bankType" placeholder="请选择" @change="changes">
            <el-option v-for="item in bankOptionone" :key="item.id" :label="item.label" :value="item.id">
            </el-option>
          </el-select> -->
            <el-input v-model="fromSettle.bankName" placeholder="请输入" :style="{width: inputWidth}"
              :disabled="bankRegionAvalue.length==0?false:true"></el-input>
            <el-tooltip class="item" effect="dark" content="如需更改开户行，请先删除银行地区" placement="top-start"
              v-if="bankRegionAvalue.length!=0">
              <div class="el-icon-question" style="color: red;margin-left: 10px;cursor: pointer"></div>
            </el-tooltip>
          </div>
        </div>
        <div class="list">
          <div class="lable">银行地区:</div>
          <div class="text" v-if="!settlementShow">{{ settleInfo.areaName }}</div>
          <div v-if="settlementShow">
            <el-cascader :options="bankRegionOptions" :props="{ value: 'id',label: 'label',children: 'children'}"
              filterable @change="bankRegionChange" v-model="bankRegionAvalue" clearable>
            </el-cascader>
          </div>
        </div>
        <div class="list">
          <div class="lable">所属支行名称:</div>
          <div class="text" v-if="!settlementShow">
            {{ settleInfo.openAccBankname }}
          </div>
          <div class="txt" v-if="settlementShow">
            <el-select v-model="fromSettle.openAccBanktype" placeholder="请选择" @change="changesTwo">
              <el-option v-for="item in bankOptiontwo" :key="item.bankCode" :label="item.bankName"
                :value="item.bankCode">
              </el-option>
            </el-select>
          </div>
        </div>
        <div class="list">
          <div class="lable">银行预留手机号:</div>
          <div class="text" v-if="!settlementShow">
            {{ settleInfo.bankMobile }}
          </div>
          <div v-if="settlementShow">
            <el-input v-model="fromSettle.bankMobile" placeholder="请输入" :style="{width: inputWidth}"></el-input>
          </div>
        </div>
        <div class="list">
          <div class="lable">结算类型:</div>
          <div class="text" v-if="!settlementShow">
            {{ settleInfo.clearingTypeDict }}
          </div>
          <div class="txt" v-if="settlementShow">
            <el-select v-model="fromSettle.clearingType" placeholder="请选择">
              <el-option v-for="item in options3" :key="item.id" :label="item.value" :value="item.id">
              </el-option>
            </el-select>
          </div>
        </div>
        <div class="list" style="margin-bottom: 30px">
          <div class="lable">结算账户名称:</div>
          <div class="text" v-if="!settlementShow">
            {{ settleInfo.balanceAccName }}
          </div>
          <div v-if="settlementShow">
            <el-input v-model="fromSettle.balanceAccName" placeholder="请输入" :style="{width: inputWidth}"></el-input>
          </div>
        </div>
        <template v-if="fromBase.merchantType=='1' && fromSettle.settleBankType=='2'">  <!-- 备用结算信息（企业商户对法人私卡结算时，需要填写备用结算信息） -->
          <div class="list" style="position: relative;">
            <p class="standby_txt">备用结算信息：（请填写对公账户信息）</p>
            <div class="lable">结算银行卡号:</div>
            <div class="text" v-if="!settlementShow">
              {{ settleInfo.standStlAccNo }}
            </div>
            <div v-if="settlementShow" >
              <el-input v-model="fromSettle.standStlAccNo" placeholder="请输入" style="width: 200px; padding-right: 10px;"></el-input>
              <el-button size="small" type="primary" @click="openingBankStand(fromSettle.standStlAccNo)">查询匹配开户行</el-button>
            </div>
          </div>
          <div class="list">
            <div class="lable">开户行名称:</div>
            <div class="text" v-if="!settlementShow">
              {{ settleInfo.localStandBankName }}
            </div>
            <div class="txt" v-if="settlementShow">
              <el-input v-model="fromSettle.localStandBankName" placeholder="请输入" :style="{width: inputWidth}"
                :disabled="standBankRegionAvalue.length==0?false:true"></el-input>
              <el-tooltip class="item" effect="dark" content="如需更改开户行，请先删除银行地区" placement="top-start"
                v-if="standBankRegionAvalue.length!=0">
                <div class="el-icon-question" style="color: red;margin-left: 10px;cursor: pointer"></div>
              </el-tooltip>
            </div>
          </div>
          <div class="list">
            <div class="lable">银行地区:</div>
            <div class="text" v-if="!settlementShow">{{ settleInfo.standAreaName }}</div>
            <div v-if="settlementShow">
              <el-cascader :options="bankRegionOptions" :props="{ value: 'id',label: 'label',children: 'children'}"
                filterable @change="standBankRegionChange" v-model="standBankRegionAvalue" clearable>
              </el-cascader>
            </div>
          </div>
          <div class="list">
            <div class="lable">所属支行名称:</div>
            <div class="text" v-if="!settlementShow">
              {{ settleInfo.localStandBankSubName }}
            </div>
            <div class="txt" v-if="settlementShow">
              <el-select v-model="fromSettle.standBankSubCode" placeholder="请选择" filterable @change="changesTwoStand">
                <el-option v-for="item in bankOptiontwoStand" :key="item.bankCode" :label="item.bankName" :value="item.bankCode">
                </el-option>
              </el-select>
            </div>
          </div>
        </template>
        <!-- <div class="list" style="align-items: center">
          <div class="lable">微信授权:</div>
          <div class="text" style="width: 130px">
            <span v-if="settleInfo.wechat==1">未授权</span>
            <span v-if="settleInfo.wechat==2">已授权</span>
          </div>
          <div class="lable">支付宝授权:</div>
          <div class="text" style="width: 130px">
            <span v-if="settleInfo.ali==1">未授权</span>
            <span v-if="settleInfo.ali==2">已授权</span>
          </div>
          <div>
            <el-button size="small" type="primary" @click="empowerQuery" :loading="empowerLoading"
              v-if="settleInfo.wechat!=''">查询</el-button>
          </div>
        </div> -->
      </div>
    </template>

    <!-- 存管结算账户资料 -->
    <DepositoryDetailYs ref="depository_detail" :id="merchantId" :pathType="pathType" v-if="fundAccountSettleType==2"
      :status="entryStatusInfo.depositEntryStatusDict" :merchantType="fromBase.merchantType"  @getfromSettleId="getfromSettleId" />
    <!-- 资质图片 -->
    <div class="bt_box">
      <p class="btText">资质图片</p>
    </div>
    <div class="imgBox" v-loading="allLoading" element-loading-text="上传中">
      <div class="imgList">
        <div class="lable">
          营业执照:
          <p class="watch_img" @click="handleFang(httpImg + ysimgInfo.businessLicence)">
            查看图片
          </p>
        </div>
        <!-- <img
          class="img"
          :src="httpImg + ysimgInfo.businessLicence"
          alt=""
          @click="handleFang(httpImg + ysimgInfo.businessLicence)"
        /> -->
        <el-upload class="avatar-uploader2" :action="action" :show-file-list="false" :on-success="
            (response, file, fileList) =>
              handleAvatarSuccess(1, response, file, fileList)
          " :before-upload="beforeAvatarUpload" :on-progress="handlePreview">
          <img v-if="ysimgInfo.businessLicence" :src="httpImg + ysimgInfo.businessLicence" class="img" />
          <i v-else class="el-icon-plus avatar-uploader-icon"></i>
        </el-upload>
      </div>
      <div class="imgList">
        <div class="lable">
          开户许可证:
          <p class="watch_img" @click="handleFang(httpImg + ysimgInfo.licence)">
            查看图片
          </p>
        </div>
        <!-- <img
          class="img"
          :src="httpImg + ysimgInfo.licence"
          alt=""
          @click="handleFang(httpImg + ysimgInfo.licence)"
        /> -->
        <el-upload class="avatar-uploader2" :action="action" :show-file-list="false" :on-success="
            (response, file, fileList) =>
              handleAvatarSuccess(2, response, file, fileList)
          " :before-upload="beforeAvatarUpload" :on-progress="handlePreview">
          <img v-if="ysimgInfo.licence" :src="httpImg + ysimgInfo.licence" class="img" />
          <i v-else class="el-icon-plus avatar-uploader-icon"></i>
        </el-upload>
      </div>
      <div class="imgList">
        <div class="lable">
          法人身份证正面:
          <p class="watch_img" @click="handleFang(httpImg + ysimgInfo.legalPersonFront)">
            查看图片
          </p>
        </div>
        <!-- <img
          class="img"
          :src="httpImg + ysimgInfo.legalPersonFront"
          alt=""
          @click="handleFang(httpImg + ysimgInfo.legalPersonFront)"
        /> -->
        <el-upload class="avatar-uploader2" :action="action" :show-file-list="false" :on-success="
            (response, file, fileList) =>
              handleAvatarSuccess(3, response, file, fileList)
          " :before-upload="beforeAvatarUpload" :on-progress="handlePreview">
          <img v-if="ysimgInfo.legalPersonFront" :src="httpImg + ysimgInfo.legalPersonFront" class="img" />
          <i v-else class="el-icon-plus avatar-uploader-icon"></i>
        </el-upload>
      </div>
      <div class="imgList">
        <div class="lable">
          法人身份证反面:
          <p class="watch_img" @click="handleFang(httpImg + ysimgInfo.legalPersonBack)">
            查看图片
          </p>
        </div>
        <!-- <img
          class="img"
          :src="httpImg + ysimgInfo.legalPersonBack"
          alt=""
          @click="handleFang(httpImg + ysimgInfo.legalPersonBack)"
        /> -->
        <el-upload class="avatar-uploader2" :action="action" :show-file-list="false" :on-success="
            (response, file, fileList) =>
              handleAvatarSuccess(4, response, file, fileList)
          " :before-upload="beforeAvatarUpload" :on-progress="handlePreview">
          <img v-if="ysimgInfo.legalPersonBack" :src="httpImg + ysimgInfo.legalPersonBack" class="img" />
          <i v-else class="el-icon-plus avatar-uploader-icon"></i>
        </el-upload>
      </div>
      <div class="imgList">
        <div class="lable">
          门头照:
          <p class="watch_img" @click="handleFang(httpImg + ysimgInfo.shopTop)">
            查看图片
          </p>
        </div>
        <!-- <img
          class="img"
          :src="httpImg + ysimgInfo.shopTop"
          alt=""
          @click="handleFang(httpImg + ysimgInfo.shopTop)"
        /> -->
        <el-upload class="avatar-uploader2" :action="action" :show-file-list="false" :on-success="
            (response, file, fileList) =>
              handleAvatarSuccess(5, response, file, fileList)
          " :before-upload="beforeAvatarUpload" :on-progress="handlePreview">
          <img v-if="ysimgInfo.shopTop" :src="httpImg + ysimgInfo.shopTop" class="img" />
          <i v-else class="el-icon-plus avatar-uploader-icon"></i>
        </el-upload>
      </div>
      <div class="imgList">
        <div class="lable">
          室内场景照:
          <p class="watch_img" @click="handleFang(httpImg + ysimgInfo.shopInterior)">
            查看图片
          </p>
        </div>
        <!-- <img
          class="img"
          :src="httpImg + ysimgInfo.shopInterior"
          alt=""
          @click="handleFang(httpImg + ysimgInfo.shopInterior)"
        /> -->
        <el-upload class="avatar-uploader2" :action="action" :show-file-list="false" :on-success="
            (response, file, fileList) =>
              handleAvatarSuccess(6, response, file, fileList)
          " :before-upload="beforeAvatarUpload" :on-progress="handlePreview">
          <img v-if="ysimgInfo.shopInterior" :src="httpImg + ysimgInfo.shopInterior" class="img" />
          <i v-else class="el-icon-plus avatar-uploader-icon"></i>
        </el-upload>
      </div>
      <div class="imgList">
        <div class="lable">
          收银台照:
          <p class="watch_img" @click="handleFang(httpImg + ysimgInfo.shopCashierDesk)">
            查看图片
          </p>
        </div>
        <!-- <img
          class="img"
          :src="httpImg + ysimgInfo.shopCashierDesk"
          alt=""
          @click="handleFang(httpImg + ysimgInfo.shopCashierDesk)"
        /> -->
        <el-upload class="avatar-uploader2" :action="action" :show-file-list="false" :on-success="
            (response, file, fileList) =>
              handleAvatarSuccess(7, response, file, fileList)
          " :before-upload="beforeAvatarUpload" :on-progress="handlePreview">
          <img v-if="ysimgInfo.shopCashierDesk" :src="httpImg + ysimgInfo.shopCashierDesk" class="img" />
          <i v-else class="el-icon-plus avatar-uploader-icon"></i>
        </el-upload>
      </div>
      <div class="imgList">
        <div class="lable">
          结算银行卡正面:
          <p class="watch_img" @click="handleFang(httpImg + ysimgInfo.bankCardFront)">
            查看图片
          </p>
        </div>
        <!-- <img
          class="img"
          :src="httpImg + ysimgInfo.bankCardFront"
          alt=""
          @click="handleFang(httpImg + ysimgInfo.bankCardFront)"
        /> -->
        <el-upload class="avatar-uploader2" :action="action" :show-file-list="false" :on-success="
            (response, file, fileList) =>
              handleAvatarSuccess(8, response, file, fileList)
          " :before-upload="beforeAvatarUpload" :on-progress="handlePreview">
          <img v-if="ysimgInfo.bankCardFront" :src="httpImg + ysimgInfo.bankCardFront" class="img" />
          <i v-else class="el-icon-plus avatar-uploader-icon"></i>
        </el-upload>
      </div>
      <div class="imgList">
        <div class="lable">
          结算银行卡反面:
          <p class="watch_img" @click="handleFang(httpImg + ysimgInfo.bankCardBack)">
            查看图片
          </p>
        </div>
        <!-- <img
          class="img"
          :src="httpImg + ysimgInfo.bankCardBack"
          alt=""
          @click="handleFang(httpImg + ysimgInfo.bankCardBack)"
        /> -->
        <el-upload class="avatar-uploader2" :action="action" :show-file-list="false" :on-success="
            (response, file, fileList) =>
              handleAvatarSuccess(9, response, file, fileList)
          " :before-upload="beforeAvatarUpload" :on-progress="handlePreview">
          <img v-if="ysimgInfo.bankCardBack" :src="httpImg + ysimgInfo.bankCardBack" class="img" />
          <i v-else class="el-icon-plus avatar-uploader-icon"></i>
        </el-upload>
      </div>
      <div class="imgList">
        <div class="lable">
          非法人身份证正面:
          <p class="watch_img" @click="handleFang(httpImg + ysimgInfo.unLegalPersonFront)">
            查看图片
          </p>
        </div>
        <!-- <img
          class="img"
          :src="httpImg + ysimgInfo.unLegalPersonFront"
          alt=""
          @click="handleFang(httpImg + ysimgInfo.unLegalPersonFront)"
        /> -->
        <el-upload class="avatar-uploader2" :action="action" :show-file-list="false" :on-success="
            (response, file, fileList) =>
              handleAvatarSuccess(10, response, file, fileList)
          " :before-upload="beforeAvatarUpload" :on-progress="handlePreview">
          <img v-if="ysimgInfo.unLegalPersonFront" :src="httpImg + ysimgInfo.unLegalPersonFront" class="img" />
          <i v-else class="el-icon-plus avatar-uploader-icon"></i>
        </el-upload>
      </div>
      <div class="imgList">
        <div class="lable">
          非法人身份证反面:
          <p class="watch_img" @click="handleFang(httpImg + ysimgInfo.unLegalPersonBack)">
            查看图片
          </p>
        </div>
        <!-- <img
          class="img"
          :src="httpImg + ysimgInfo.unLegalPersonBack"
          alt=""
          @click="handleFang(httpImg + ysimgInfo.unLegalPersonBack)"
        /> -->
        <el-upload class="avatar-uploader2" :action="action" :show-file-list="false" :on-success="
            (response, file, fileList) =>
              handleAvatarSuccess(11, response, file, fileList)
          " :before-upload="beforeAvatarUpload" :on-progress="handlePreview">
          <img v-if="ysimgInfo.unLegalPersonBack" :src="httpImg + ysimgInfo.unLegalPersonBack" class="img" />
          <i v-else class="el-icon-plus avatar-uploader-icon"></i>
        </el-upload>
      </div>
      <!-- <div class="imgList" v-if="ysimgInfo.handIdCard">
        <div class="lable">法人持授权书正面照:</div>
        <img
          class="img"
          :src="httpImg + ysimgInfo.handIdCard"
          alt=""
        />
      </div> -->
      <div class="imgList">
        <div class="lable">
          法人手持身份证合照:
          <p class="watch_img" @click="handleFang(httpImg + ysimgInfo.handIdCard)">
            查看图片
          </p>
        </div>
        <!-- <img
          class="img"
          :src="httpImg + ysimgInfo.handIdCard"
          alt=""
          @click="handleFang(httpImg + ysimgInfo.handIdCard)"
        /> -->
        <el-upload class="avatar-uploader2" :action="action" :show-file-list="false" :on-success="
            (response, file, fileList) =>
              handleAvatarSuccess(12, response, file, fileList)
          " :before-upload="beforeAvatarUpload" :on-progress="handlePreview">
          <img v-if="ysimgInfo.handIdCard" :src="httpImg + ysimgInfo.handIdCard" class="img" />
          <i v-else class="el-icon-plus avatar-uploader-icon"></i>
        </el-upload>
      </div>
      <div class="imgList">
        <div class="lable">
          面签二联单合同:
          <p class="watch_img" @click="handleFang(httpImg + ysimgInfo.contract)">
            查看图片
          </p>
        </div>
        <el-upload class="avatar-uploader2" :action="action" :show-file-list="false" :on-success="
            (response, file, fileList) =>
              handleAvatarSuccess(13, response, file, fileList)
          " :before-upload="beforeAvatarUpload" :on-progress="handlePreview">
          <img v-if="ysimgInfo.contract" :src="httpImg + ysimgInfo.contract" class="img" />
          <i v-else class="el-icon-plus avatar-uploader-icon"></i>
        </el-upload>
      </div>
      <div class="imgList" v-if="fromBase.merchantType=='1' && fromSettle.settleBankType=='2'">
        <div class="lable">
          清算授权书:
          <p class="watch_img" @click="handleFang(httpImg + ysimgInfo.liquidationAuthorization)">
            查看图片
          </p>
        </div>
        <el-upload class="avatar-uploader2" :action="action" :show-file-list="false" :on-success="
            (response, file, fileList) =>
              handleAvatarSuccess(14, response, file, fileList)
          " :before-upload="beforeAvatarUpload" :on-progress="handlePreview">
          <img v-if="ysimgInfo.liquidationAuthorization" :src="httpImg + ysimgInfo.liquidationAuthorization" class="img" />
          <i v-else class="el-icon-plus avatar-uploader-icon"></i>
        </el-upload>
      </div>
    </div>
    <img-detail-dialog v-if="ImgDetailDialog" :id="id" :imgUrl="urlData" :visible.sync="ImgDetailDialog" />
    <div class="button_box" v-if="pathType != 'merchantsDetail'">
      <el-button style="margin: 0 10px 0 20px"
        v-if="fundAccountSettleType==1&&entryStatusInfo.everydayEntryStatus != 'AUDITED'"
        @click="setYspush(data.id)" type="primary" plain :loading="buttomLoading">开通日常消费账户</el-button>
      <el-button style="margin: 0 10px 0 20px"
        v-if="fundAccountSettleType==2&&entryStatusInfo.depositEntryStatus != 'AUDITED'"
        @click="setYspush(data.id)" type="primary" plain :loading="buttomLoading">开通存管账户</el-button>

      <el-button @click="handleMessage(merchantId)" :loading="messageLoading"
        v-if="entryStatusInfo.everydayEntryStatus == 'FAIL_SIGN'&&fundAccountSettleType==1" type="primary">
        重新推送签约短信</el-button>
      <el-button @click="handleMessage(merchantId)" :loading="messageLoading"
        v-if="entryStatusInfo.depositEntryStatus == 'FAIL_SIGN'&&fundAccountSettleType==2" type="primary">
        重新推送签约短信</el-button>
    </div>
    <!-- 结算信息变更弹窗 -->
    <SettleInfoChange ref="settleInfoRef" @success="settlementSuccess" />
    <!-- 费率信息变更弹窗 -->
    <RateInforChange ref="rateInforRef" @success="getentryStatus" />
  </div>
</template>
<script>
  // components
  import Loading from "@/components/Loading/index";
  import imgDetailDialog from "./components/imgDetailDialog";
  import DepositoryDetailYs from "./components/depositoryDetailYs";
  import SettleInfoChange from "./components/settleInfoChangeYisheng";
  import RateInforChange from "./components/rateInforChangeYisheng";
  //api
  import {
    getqueryStatus,
    ysBaseYisheng,
    settle,
    ysImgYisheng,
    adminDict,
    shopTypeTree,
    updateBaseYisheng,
    yscontractImg,
    getBank,
    updateSettleYisheng,
    yscontract,
    ysPushYisheng,
    ysRefuse,
    updateOtherimgYisheng,
    entryStatusYisheng,
    entrySettleYisheng,
    getBankCity,
    getBankBranch,
    getMerchantCity,
    getYsMcc,
    ysAuthState,
    entryV1FuncYSBankBin,
    yishengSignApply
  } from "@/api/merchants";
  import {
    ysSendSignSms,
  } from "@/api/moneyManagement";
  export default {
    components: {
      Loading,
      imgDetailDialog,
      DepositoryDetailYs,
      SettleInfoChange,
      RateInforChange
    },
    props: {
      visible: Boolean,
      id: String,
    },
    data() {
      return {
        inputWidth: '200px',
        viewLoading: false,
        messageLoading: false,
        fromSettleId: "", //存管id
        settleInfoDialog: false, //结算信息变更弹窗
        settleInfoId: '', //结算信息id
        basicLoading: false, //子商户进件基本资料按钮Loading
        settleLoading: false, //日常消费结算按钮Loading
        allLoading: false,
        buttomLoading: false,
        buttomLoading2: false,
        empowerLoading: false, //授权查询loading
        action: process.env.VUE_APP_BASE_API + "/common/v1/uploadFile",
        detailDialog: false,
        fundId: "",
        data: {},
        ImgDetailDialog: false,
        settleInfo: {},
        ysimgInfo: {},
        credentials: {},
        httpImg: '',
        options: [],
        options2: [],
        options3: [],
        value: "",
        input: "",
        basicModifyshow: false,
        settlementShow: false,
        entryStatus: "",
        merchantId: "",
        typeLs: [],
        avalue: [],
        entryStatusInfo: {}, //子商户进件状态
        ysimgurl: "", //二联单合同图片路径
        regionOptions: [], //城市数组
        bankRegionOptions: [], //银行城市数组
        regionAvalue: [], //城市回显
        bankRegionAvalue: [], //银行城市选择回显
        ysMccList: [], //mcc下拉
        fundAccountSettleType: '', // 1为日常收款 2为存管
        standBankRegionAvalue:[],//备用银行城市回显
        fromBase: {
          id: "",
          merchantId: "", //商家id
          businessLicence: "", //企业名称
          businessLicenceNo: "", //统一社会信用代码
          businessLicenceSdate: "", //营业执照开始日期
          businessLicenceEdate: "", //营业执照结束日期
          legalPersonName: "", //法人姓名
          legalPersonId: "", //法人身份证号
          legalPersonIdSdate: "", //法人身到期日期
          legalPersonIdEdate: "", //法人身份证开始日期
          phone: "", //法人联系电话
          registeredAddress: "", //注册地址
          merchantType: "", //商户类型
          shopTypeParent: "", //店铺类型父类型
          shopType: "", //店铺类型
          shopName: "", //店铺名称
          mercProv: "", //省
          mercCity: "", //市
          mercArea: "", //区
          mccCd: "", //mcc码
          businForm:'',//易生经营形态 yisheng_busin_form 经营形态：02-普通店、01-连锁店
          capital:'',//易生注册资本：单位-万元
          employeeNum:'',//易生公司规模 yisheng_employee_num :1：0-50人；2：50-100人；3:100以上
          businScope:'',//易生主营业务
        },
        fromSettle: {
          id: "",
          merchantId: "", //商家id
          settleBankType: "", //结算方式
          clearingType: "", //结算类型
          fee: "", //费率
          balanceAccCardno: "", //结算银行卡号
          bankName: "", //开户行名称
          bankType: "", //开户行code
          openAccBanktype: "", //所属支行code
          openAccBankname: "", //所属支行名称
          bankMobile: "", //银行预留电话
          balanceAccName: "", //结算账户名称
          province: "", //省
          city: "", //市
          standStlAccNo:'',//备用结算账号
          localStandBankName:'',//备用结算银行名称
          standAreaName:'',//备用银行地区回显
          localStandBankSubName:'',//备用支行名称
          standBankCity:'',//备用结算账户银行开户行市代码
          standBankProvince:'',//备用结算账户银行开户行省代码
          standBankSubCode:'',//备用结算账户开户行支行编号
        },
        qxDate: "",
        radio: 2, //经营期限选择
        pickDisabled: true, //是否禁用经营期限时间选择
        bankOptionone: [], //银行
        bankOptiontwo: [], //支行
        bankOptiontwoStand:[],//备用支行
        formOtherimg: {
          id: "",
          businessLicence: "", //营业执照
          licence: "", //开户许可证
          legalPersonFront: "", //法人身份证正面
          legalPersonBack: "", //法人身份证背面
          shopTop: "", //商户门头照
          shopInterior: "", //内景照片
          bankCardFront: "", //结算账户正面
          bankCardBack: "", //结算账户背面
          shopCashierDesk: "", //收银台照片
          handIdCard: "", //手持身份证照片
          unLegalPersonFront: "", //非法人身份证正面
          unLegalPersonBack: "", //非法人身份证反面
          contract: "", //面签二联单合同
          liquidationAuthorization:'',//易生清算授权书
        },
        pathType: '',
        businessModel:[],//经营形态
        scaleOptions:[],//公司规模下拉
        signLoading: false,//获取签约链接按钮loading
        signUrl:'',//签约链接
      };
    },
    computed: {},
    created() {
      // this.merchantId = this.$route.query.merchantId;
      // this.entryStatus = this.$route.query.entryStatus;
      // this.pathType = this.$route.query.pathType;
      // this.fundAccountSettleType = this.$route.query.fundAccountSettleType
      // this.getYsMccOption();
      // this.getclearingType();
      // this.getlinkagelist();
      // this.getTypels();
      // this.getbankType();
      // this.getentryStatus();
      // this.getMerchantCity();
      // this.getBankCitys();
      // this.getDetail();
      // this.getentrySettle();
      // this.getysImg();
      // this.getApi()
    },
    methods: {
      getApi(){
        this.merchantId = this.$route.query.merchantId;
        this.entryStatus = this.$route.query.entryStatus;
        this.pathType = this.$route.query.pathType;
        this.fundAccountSettleType = this.$route.query.fundAccountSettleType
        this.getYsMccOption();
        this.getclearingType();
        this.getlinkagelist();
        this.getTypels();
        this.getbankType();
        this.getentryStatus();
        this.getMerchantCity();
        this.getBankCitys();
        this.getDetail();
        this.getentrySettle();
        this.getysImg();
      },
      //获取签约链接
      getYishengSignApply(){
        this.signLoading = true
        let id = ''
        if(this.fundAccountSettleType==1){ //日常
          id = this.entryStatusInfo.everydayFundAccountId
        }else{ //存管
          id = this.entryStatusInfo.depositFundAccountId
        }
        console.log('this.fundAccountSettleType',this.fundAccountSettleType,id)
        // return
        yishengSignApply(id).then((res) => {
          this.$message({
            message: '操作成功',
            type: 'success'
          });
          this.getentryStatus()
          this.signLoading = false
        }).catch(()=>{
          this.signLoading = false
        })
      },
      //复制
      onCopy(e) {
        this.$message({
          message: '复制成功',
          type: 'success'
        });
      },
      settleInfoDialogShow(id, type, status) { //结算信息变更
        // this.settleInfoDialog = true
        this.$refs.settleInfoRef.open(id, type, status)
      },
      rateInforDialogShow(id, type, status) { //结算信息变更
        this.$refs.rateInforRef.open(id, type, status)
      },
      cancellationBasicModifyshow() { //子商户进件基本资料取消
        this.basicModifyshow = false
        this.getDetail()
      },
      cancelSettlementShow() { //日常消费结算账户资料取消
        this.settlementShow = false
        this.getentrySettle()
      },
      getYsMccOption() { //中台查询银盛mcc
        let params = {
          merchantId: this.merchantId
        }
        getYsMcc(params).then((res) => {
          this.ysMccList = res.result;
        });
      },
      getBankCitys() { //中台查询银行银盛城市
        let params = {}
        getBankCity(params).then((res) => {
          this.bankRegionOptions = res.result;
          this.bankRegionOptions.forEach((item) => {
            item.children.forEach((items) => {
              if (items.children.length == 0) {
                items.children = null
              }
            })
          })
        });
      },
      getMerchantCity() { //中台查询营业地区
        let params = {}
        getMerchantCity(params).then((res) => {
          this.regionOptions = res.result;
          this.regionOptions.forEach((item) => {
            item.children.forEach((items) => {
              if (items.children.length == 0) {
                items.children = null
              } else {
                items.children.forEach((itemss) => {
                  if (itemss.children.length == 0) {
                    itemss.children = null
                  }
                })
              }
            })
          })
        });
      },
      //城市区域选择
      regionChange(value) {
        this.fromBase.mercProv = value[0];
        this.fromBase.mercCity = value[1];
        if (value.length == 3) {
          this.fromBase.mercArea = value[2];
        } else {
          this.fromBase.mercArea = ''
        }
        console.log(this.fromBase.mercProv, this.fromBase.mercCity, this.fromBase.mercArea)
      },
      getlinkagelist() {
        //获取字典
        const params = {
          dictType: "merchant_type,yisheng_busin_form,yisheng_employee_num",
        };
        adminDict(params).then((res) => {
          this.options = res.result[0].dictList;
          this.businessModel = res.result[1].dictList; //营业形态
          this.scaleOptions = res.result[2].dictList; //公司规模
        });
      },
      getclearingType() {
        //获取结算类型字典
        const params = {
          dictType: "merchant_clearing_type",
        };
        adminDict(params).then((res) => {
          this.options3 = res.result[0].dictList;
        });
      },
      settlementSuccess() {
        this.getentryStatus()
        this.getentrySettle()
        this.$refs.depository_detail.open();
      },
      getentryStatus() {
        //查询商家进件状态
        const merchantId = this.merchantId;
        entryStatusYisheng(merchantId)
          .then((res) => {
            this.entryStatusInfo = res.result;
            if(this.fundAccountSettleType==1){ //日常签约链接
              this.signUrl = this.entryStatusInfo.everydaySignUrl
            }else{ //存管签约链接
              this.signUrl = this.entryStatusInfo.depositSignUrl
            }
          })
          .finally(() => {
            this.loading = false;
          });
      },
      getentrySettle() {
        //查询银盛进件商户日常结算账户信息
        const merchantId = this.merchantId;
        entrySettleYisheng(merchantId)
          .then((res) => {
            // this.entryStatusInfo = res.result;
            this.settleInfo = res.result;
            this.fromSettle.id = res.result.id;
            this.fromSettle.merchantId = this.merchantId;
            this.fromSettle.settleBankType = res.result.settleBankType;
            this.fromSettle.clearingType = res.result.clearingType;
            this.fromSettle.fee = res.result.fee;
            this.fromSettle.balanceAccCardno = res.result.balanceAccCardno;
            this.fromSettle.bankMobile = res.result.bankMobile;
            this.fromSettle.openAccBanktype = res.result.openAccBanktype;
            this.fromSettle.bankType = res.result.bankType;
            this.fromSettle.bankName = res.result.bankName;
            this.fromSettle.openAccBankname = res.result.openAccBankname;
            this.fromSettle.balanceAccName = res.result.balanceAccName
            //处理所属区域回显
            if (res.result.province != '') {
              let bankRegionAvalue = [];
              bankRegionAvalue.push(res.result.province);
              bankRegionAvalue.push(res.result.city);
              bankRegionAvalue.join(",");
              this.bankRegionAvalue = bankRegionAvalue;
              this.fromSettle.province = res.result.province;
              this.fromSettle.city = res.result.city
              this.getBank();
            } else {
              this.bankRegionAvalue = [];
              this.fromSettle.province = res.result.province;
              this.fromSettle.city = res.result.city
            }

            if (this.fromSettle.province != '') {
              this.getBankBranchs();
            }
            //备用信息 standBankRegionAvalue
            this.fromSettle.standStlAccNo = res.result.standStlAccNo
            this.fromSettle.localStandBankName = res.result.localStandBankName
            this.fromSettle.standAreaName = res.result.standAreaName
            this.fromSettle.localStandBankSubName = res.result.localStandBankSubName
            this.fromSettle.standBankCity = res.result.standBankCity
            this.fromSettle.standBankProvince = res.result.standBankProvince
            this.fromSettle.standBankSubCode = res.result.standBankSubCode
            //处理备用所属区域回显
            if (res.result.standBankProvince != '') {
              let standBankRegionAvalue = [];
              standBankRegionAvalue.push(res.result.standBankProvince);
              standBankRegionAvalue.push(res.result.standBankCity);
              standBankRegionAvalue.join(",");
              this.standBankRegionAvalue = standBankRegionAvalue;
              this.fromSettle.standBankProvince = res.result.standBankProvince;
              this.fromSettle.standBankCity = res.result.standBankCity
              this.getBank();
            } else {
              this.standBankRegionAvalue = [];
              this.fromSettle.standBankProvince = res.result.standBankProvince;
              this.fromSettle.standBankCity = res.result.standBankCity
            }
            if (this.fromSettle.standBankProvince != '') {
              this.getBankBranchsStand();
            }
          })
          .finally(() => {
            this.loading = false;
          });
      },
      // 授权查询 
      empowerQuery() {
        this.empowerLoading = true
        ysAuthState(this.settleInfo.accountId)
          .then((res) => {
            this.$message.success('查询成功');
            this.getentrySettle()
            this.empowerLoading = false;
          })
          .catch(() => {
            this.empowerLoading = false
          });
      },
      // 获取店铺类型
      getTypels() {
        //shopTypeTree
        this.loading = true;
        shopTypeTree()
          .then((res) => {
            let ls = [];
            ls = this.getTreeData(res.result);
            let ls1 = ls.map((item) => {
              item.value = item.id;
              item.children.map((items) => {
                items.value = items.id;
              });
              return item;
            });
            this.typeLs = ls1;
          })
          .finally(() => {
            this.loading = false;
          });
      },
      handleChange(value) {
        let _this = this;
        _this.fromBase.shopTypeParent = value[0];
        _this.fromBase.shopType = value[1];
      },
      getTreeData(data) {
        // 循环遍历json数据
        for (var i = 0; i < data.length; i++) {
          if (data[i].children.length < 1) {
            // children若为空数组，则将children设为undefined
            // data[i].children=undefined;
            delete data[i].children;
          } else {
            // children若不为空数组，则继续 递归调用 本方法
            this.getTreeData(data[i].children);
          }
        }
        return data;
      },
      changeRadio(e) {
        //经营期限选择
        if (e == 2) {
          this.pickDisabled = true;
          this.fromBase.businessLicenceEdate = "长期";
        } else {
          this.pickDisabled = false;
          this.fromBase.businessLicenceEdate = this.qxDate;
        }
      },
      changeDate(e) {
        //经营期限日期选择
        this.fromBase.businessLicenceEdate = e;
      },
      //获取进件商户基础信息
      getDetail() {
        // const merchantId = this.merchantId;
        let params = {
          merchantId: this.merchantId,
          fundAccountSettleType: this.fundAccountSettleType
        }
        ysBaseYisheng(params)
          .then((res) => {
            this.data = res.result;
            if (res.result.businessLicenceEdate == "长期") {
              this.fromBase.businessLicenceEdate = "长期";
              this.radio = 2;
              this.pickDisabled = true;
            } else {
              this.qxDate = res.result.businessLicenceEdate;
              this.pickDisabled = false;
              this.radio = 1;
              this.fromBase.businessLicenceEdate = this.qxDate;
            }
            this.fromBase.id = res.result.id;
            this.fromBase.merchantId = this.merchantId;
            this.fromBase.merchantType = res.result.merchantType;
            this.fromBase.businessLicence = res.result.businessLicence;
            this.fromBase.businessLicenceNo = res.result.businessLicenceNo;
            this.fromBase.businessLicenceSdate = res.result.businessLicenceSdate;
            // this.fromBase.businessLicenceEdate = res.result.businessLicenceEdate;
            this.fromBase.legalPersonName = res.result.legalPersonName;
            this.fromBase.legalPersonId = res.result.legalPersonId;
            this.fromBase.legalPersonIdSdate = res.result.legalPersonIdSdate;
            this.fromBase.legalPersonIdEdate = res.result.legalPersonIdEdate;
            this.fromBase.phone = res.result.phone;
            this.fromBase.shopName = res.result.shopName;
            this.fromBase.registeredAddress = res.result.registeredAddress;
            this.fromBase.mccCd = res.result.mccCd;
            this.fromBase.businForm = res.result.businForm;
            this.fromBase.capital = res.result.capital;
            this.fromBase.employeeNum = res.result.employeeNum;
            this.fromBase.businScope = res.result.businScope;
            //处理店铺回显
            let value = [];
            value.push(res.result.shopTypeParent);
            value.push(res.result.shopType);
            value.join(",");
            this.avalue = value;
            this.fromBase.shopTypeParent = value[0];
            this.fromBase.shopType = value[1];
            //处理所属区域回显
            let regionAvalue = [];
            regionAvalue.push(res.result.mercProv);
            regionAvalue.push(res.result.mercCity);
            if (res.result.mercArea != '') {
              regionAvalue.push(res.result.mercArea);
            }
            regionAvalue.join(",");
            this.regionAvalue = regionAvalue;
            this.fromBase.mercProv = res.result.mercProv
            this.fromBase.mercCity = res.result.mercCity
            this.fromBase.mercArea = res.result.mercArea
          })
          .finally(() => {
            this.loading = false;
          });
      },
      getsettleInfo() {
        //获取商户结算账户信息
        const merchantId = this.merchantId;
        settle(merchantId)
          .then((res) => {
            this.settleInfo = res.result;
            this.fromSettle.id = res.result.id;
            this.fromSettle.merchantId = this.merchantId;
            this.fromSettle.settleBankType = res.result.settleBankType;
            this.fromSettle.clearingType = res.result.clearingType;
            this.fromSettle.fee = res.result.fee;
            this.fromSettle.balanceAccCardno = res.result.balanceAccCardno;
            this.fromSettle.bankMobile = res.result.bankMobile;
            this.fromSettle.openAccBanktype = res.result.openAccBanktype;
            this.fromSettle.bankType = res.result.bankType;
            this.fromSettle.bankName = res.result.bankName;
            this.fromSettle.openAccBankname = res.result.openAccBankname;
            this.getBank();
          })
          .finally(() => {
            this.loading = false;
          });
      },
      getbankType() {
        //获取结算方式字典
        const params = {
          dictType: "manage_settle_bank_type",
        };
        adminDict(params).then((res) => {
          this.options2 = res.result[0].dictList;
        });
      },
      getBank() {
        //获取银行信息
        const params = {};
        getBank(params).then((res) => {
            this.bankOptionone = res.result;
            // if (this.fromSettle.bankType != "") {
            //   this.bankOptionone.map((item, index) => {
            //     if (this.fromSettle.bankType == item.id) {
            //       this.bankOptiontwo = item.children;
            //     }
            //   });
            // }
          })
          .finally(() => {
            this.loading = false;
          });
      },
      changes(value) {
        //银行
        this.bankOptionone.map((item, index) => {
          if (value == item.id) {
            // this.bankOptiontwo = item.children;
            this.fromSettle.bankType = item.id;
            this.fromSettle.bankName = item.label;
          }
        });
        // this.getBankBranchs()
        this.fromSettle.openAccBanktype = "";
      },
      //银行区域选择
      bankRegionChange(value) {
        if (value.length == 0) {
          this.bankRegionAvalue = []
          this.fromSettle.openAccBanktype = '';
          this.fromSettle.openAccBankname = '';
          this.bankOptiontwo = []
          return
        }
        this.fromSettle.province = value[0];
        this.fromSettle.city = value[1];
        if (this.fromSettle.bankName == '') {
          this.$message.error('请输入开户行名称');
          this.bankRegionAvalue = []
          this.fromSettle.openAccBanktype = '';
          this.fromSettle.openAccBankname = '';
          this.bankOptiontwo = []
          return
        } else {
          this.getBankBranchs()
        }
        this.fromSettle.openAccBanktype = '';
        this.fromSettle.openAccBankname = '';
      },
      getBankBranchs() { //获取支行信息
        const params = {
          bankName: this.fromSettle.bankName,
          cityId: this.fromSettle.city,
          provinceId: this.fromSettle.province
        };
        this.viewLoading = true
        getBankBranch(params).then((res) => {
            this.bankOptiontwo = res.result
            this.viewLoading = false
          })
          .catch(() => {
            this.viewLoading = false;
          });
      },
      changesTwo(id) {
        //支行选择
        console.log(id)
        this.bankOptiontwo.map((item, index) => {
          if (id == item.bankCode) {
            this.fromSettle.openAccBanktype = item.bankCode;
            this.fromSettle.openAccBankname = item.bankName;
          }
        });
      },
      handlePreview(e) {
        this.allLoading = true;
        setTimeout(() => {
          this.allLoading = false;
        }, 10000);
      },
      getysImg() {
        //获取资质图片
        let params = {
          merchantId: this.merchantId,
          fundAccountSettleType: this.fundAccountSettleType
        }
        ysImgYisheng(params)
          .then((res) => {
            this.ysimgInfo = res.result;
            this.ysimgurl = res.result.contract;
          })
          .finally(() => {
            this.loading = false;
          });
      },
      handleAvatarSuccess(e, res, file) {
        this.allLoading = true;
        //上传资质图片
        //   this.formInline.shopIcon = res.result.url;
        // this.formOtherimg.id = this.ysimgInfo.id;
        this.formOtherimg = {
          id: this.ysimgInfo.id,
          businessLicence: "", //营业执照
          licence: "", //开户许可证
          legalPersonFront: "", //法人身份证正面
          legalPersonBack: "", //法人身份证背面
          shopTop: "", //商户门头照
          shopInterior: "", //内景照片
          bankCardFront: "", //结算账户正面
          bankCardBack: "", //结算账户背面
          shopCashierDesk: "", //收银台照片
          handIdCard: "", //手持身份证照片
          unLegalPersonFront: "", //非法人身份证正面
          unLegalPersonBack: "", //非法人身份证反面
          contract: "", //面签二联单合同
          liquidationAuthorization:'',//清算授权书
        }
        if (e == 1) {
          this.formOtherimg.businessLicence = res.result.url;
        } else if (e == 2) {
          this.formOtherimg.licence = res.result.url;
        } else if (e == 3) {
          this.formOtherimg.legalPersonFront = res.result.url;
        } else if (e == 4) {
          this.formOtherimg.legalPersonBack = res.result.url;
        } else if (e == 5) {
          this.formOtherimg.shopTop = res.result.url;
        } else if (e == 6) {
          this.formOtherimg.shopInterior = res.result.url;
        } else if (e == 7) {
          this.formOtherimg.shopCashierDesk = res.result.url;
        } else if (e == 8) {
          this.formOtherimg.bankCardFront = res.result.url;
        } else if (e == 9) {
          this.formOtherimg.bankCardBack = res.result.url;
        } else if (e == 10) {
          this.formOtherimg.unLegalPersonFront = res.result.url;
        } else if (e == 11) {
          this.formOtherimg.unLegalPersonBack = res.result.url;
        } else if (e == 12) {
          this.formOtherimg.handIdCard = res.result.url;
        } else if (e == 13) {
          this.formOtherimg.contract = res.result.url;
        }else if (e == 14) {
          this.formOtherimg.liquidationAuthorization = res.result.url;
        }
        var params = {
          ...this.formOtherimg,
        };
        updateOtherimgYisheng(params)
          .then((res) => {
            this.$message({
              message: "上传成功",
              type: "success",
              duration: 1500,
            });
            setTimeout(() => {
              this.getysImg();
              this.allLoading = false;
            }, 800);
          })
          .finally(() => {
            this.allLoading = false;
          });
      },
      //放大图片
      handleFang(url) {
        // this.urlData = url;
        // this.ImgDetailDialog = true;
        this.urlData = url;
        let routeData = this.$router.resolve({path:'/merchants/img-show', query: {url:url}});
        window.open(routeData.href, '_blank');
      },
      fileArr(data) {
        if (data) {
          if (data.length > 1) {
            return data.join(",");
          } else if (data.length <= 1) {
            return data[0];
          }
        }
      },
      avatarSuccess(res, file, fileList) {
        //面签二联单合同图片上传
        //   this.formInline.shopImgs.push(res.result.url);
        this.ysimgurl = res.result.url;
        if (this.ysimgurl != "") {
          var params = {
            id: this.ysimgInfo.id,
            url: this.ysimgurl,
          };
          yscontractImg(params).then((res) => {
            this.$message({
              message: "上传成功",
              type: "success",
              duration: 1500,
            });
            setTimeout(() => {
              this.getysImg();
            }, 800);
          });
        }
      },
      onExceed(files, fileList) {
        this.$message.error("最多上传1张图片");
      },
      detailImg(index) {
        this.ysimgurl = "";
        //   this.formInline.shopImgs.splice(index, 1);
      },
      beforeAvatarUpload(file) {
        const format = ["image/jpeg", "image/jpg", "image/png"];
        const isJPG = format.some((item) => file.type === item);
        const isLt2M = file.size / 1024 / 1024 < 2;
        if (!isJPG) {
          this.$message.error("上传头像图片只能是 jpeg,jpg,png格式!");
        }
        //   if (!isLt2M) {
        //     this.$message.error("上传头像图片大小不能超过 2MB!");
        //   }
        // return isJPG && isLt2M;
        return isJPG;
      },
      //修改结算方式
      editSettlement() {
        const merchantNo = this.data.merchantNo;
        getapplyqueryStatus(merchantNo)
          .then((res) => {
            const {
              status
            } = res.result;
            if (status != 2 && status != 7) {
              this.$router.push({
                path: "/moneyManagement/edit-eettlement",
                query: {
                  merchantNo: this.data.merchantNo,
                  showName: this.data.showName,
                },
              });
            } else {
              this.$message({
                message: "在审核中不能修改",
                type: "warning",
                duration: 1500,
              });
            }
          })
          .finally(() => {
            this.loading = false;
          });
      },

      //修改费率
      editRate() {
        const merchantNo = this.data.merchantNo;
        getqueryStatus(merchantNo).then((res) => {
          const {
            status
          } = res.result;
          if (status != 1) {
            this.$router.push({
              path: "/moneyManagement/edit-rate",
              query: {
                merchantNo: this.data.merchantNo,
              },
            });
          } else {
            this.$message({
              message: "在审核中不能修改",
              type: "warning",
              duration: 1500,
            });
          }
        });
      },
      //查看
      lookDetail() {
        this.detailDialog = true;
      },
      //基本资料修改
      basicModify() {
        this.basicModifyshow = true;
      },
      //基本资料保存
      basicSumit() {
        var params = {
          ...this.fromBase,
        };
        this.basicLoading = true
        updateBaseYisheng(params).then((res) => {
          this.$message({
            message: "修改成功",
            type: "success",
            duration: 1500,
          });
          this.getDetail();
          setTimeout(() => {
            this.basicModifyshow = false;
            this.basicLoading = false;
          }, 800);
        }).catch(() => {
          this.basicLoading = false
        })
      },
      //日常消费结算账户结算账户资料修改
      settlementMide() {
        this.settlementShow = true;
      },
      //日常消费结算账户结算账户资料保存
      settlementSumit() {
        var params = {
          ...this.fromSettle,
        };
        this.settleLoading = true
        updateSettleYisheng(params).then((res) => {
          this.$message({
            message: "修改成功",
            type: "success",
            duration: 1500,
          });
          // this.getsettleInfo();
          this.getentrySettle();
          setTimeout(() => {
            this.settlementShow = false;
            this.settleLoading = false
          }, 800);
        }).catch(() => {
          this.settleLoading = false
        })
      },
      contractIssuance() {
        //下发电子合同
        const merchantId = this.merchantId;
        yscontract(merchantId).then((res) => {
          this.$message({
            message: "发送成功",
            type: "success",
            duration: 1500,
          });
          // setTimeout(() => {

          // }, 800);
        });
      },
      getfromSettleId(id) {
        this.fromSettleId = id;
      },
      setYspush(id) {
        //推送易生审核
        this.buttomLoading = true
        ysPushYisheng(id)
          .then((res) => {
            this.$message({
              message: "发送成功",
              type: "success",
              duration: 1500,
            });
            this.getentryStatus()
            setTimeout(() => {
              this.buttomLoading = false;
            }, 800);
          })
          .catch(() => {
            setTimeout(() => {
              this.buttomLoading = false;
            }, 800);
          });
      },
      //推送短信
      handleMessage(merchantId) {
        var params = {
          merchantId: merchantId,
        };
        this.messageLoading = true
        ysSendSignSms(params).then((res) => {
          if (res.code == 200) {
            this.$message.success("发送成功");
            this.messageLoading = false
          }
        }).catch(()=>{
          this.messageLoading = false
        })
      },
      ysRefuse() {
        //拒绝商家入驻
        this.$prompt("请输入拒绝原因", "提示", {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            inputPattern: /\S/,
            inputErrorMessage: "请输入拒绝原因",
          })
          .then(({
            value
          }) => {
            const params = {
              merchantId: this.merchantId,
              remark: value,
            };
            ysRefuse(params).then((res) => {
              this.$message({
                message: "已拒绝",
                type: "success",
                duration: 1500,
              });
              setTimeout(() => {
                this.getDetail();
              }, 800);
            });
          })
          .catch(() => {
            this.$message({
              type: "info",
              message: "取消输入",
            });
          });
      },
      // 查询匹配开户行
      openingBank(e){
        var params = {
          bankCardNo:e
        }
        entryV1FuncYSBankBin(params).then(res=>{
          var {bankName,bankType} = res.result
          if(bankName!= '' && bankType!=''){
             // this.settleInfo.bankName = 
              this.fromSettle.bankName = bankName
              this.fromSettle.bankType = bankType
              this.$message({ message: "查询成功", type: "success", duration: 1500,});
          }else{
            this.$message({ message:'未查询到银行卡开户行相关信息', type: "error", duration: 1500,});
          }
        })
        // settleInfo.bankName
        // this.fromSettle
      },
      // 查询备用匹配开户行
      openingBankStand(e){
        var params = {
          bankCardNo:e
        }
        entryV1FuncYSBankBin(params).then(res=>{
          var {bankName} = res.result
          if(bankName!= ''){
              this.fromSettle.localStandBankName = bankName
              // this.fromSettle.bankType = bankType
              this.$message({ message: "查询成功", type: "success", duration: 1500,});
          }else{
            this.$message({ message:'未查询到银行卡开户行相关信息', type: "error", duration: 1500,});
          }
        })
      },
      //备用银行区域选择
      standBankRegionChange(value){
        if (value.length == 0) {
          this.standBankRegionAvalue = []
          this.fromSettle.standBankSubCode = '';
          this.fromSettle.localStandBankSubName = '';
          this.bankOptiontwoStand = []
          return
        }
        this.fromSettle.standBankProvince = value[0];
        this.fromSettle.standBankCity = value[1];
        if (this.fromSettle.bankName == '') {
          this.$message.error('请输入开户行名称');
          this.standBankRegionAvalue = []
          this.fromSettle.standBankSubCode = '';
          this.fromSettle.localStandBankSubName = '';
          this.bankOptiontwoStand = []
          return
        } else {
          this.getBankBranchsStand()
        }
        this.fromSettle.standBankSubCode = '';
        this.fromSettle.localStandBankSubName = '';
      },
      getBankBranchsStand() { //获取备用支行信息
        const params = {
          bankName: this.fromSettle.localStandBankName,
          cityId: this.fromSettle.standBankCity,
          provinceId: this.fromSettle.standBankProvince
        };
        this.viewLoading = true
        getBankBranch(params).then((res) => {
            this.bankOptiontwoStand = res.result
            this.viewLoading = false
          })
          .catch(() => {
            this.viewLoading = false;
          });
      },
      //备用支行选择
      changesTwoStand(id) {
        //支行选择
        this.bankOptiontwoStand.map((item, index) => {
          if (id == item.bankCode) {
            this.fromSettle.standBankSubCode = item.bankCode;
            this.fromSettle.localStandBankSubName = item.bankName;
          }
        });
      },
    }
  };

</script>
<style lang="scss" scoped>
  @import "../style/incomingDetail";

  .flex {
    display: flex;
    align-items: center;
  }

  .el-icon-plus {
    font-size: 30px;
  }

  .el-upload {
    height: 200px;
  }
  .standby_txt{
    position: absolute;
    top: -30px;
    font-size: 14px;
    color: #1890ff;
  }
  .copy_icon{
    font-size: 20px;
    color: #1890ff;
    margin-left: 20px;
    cursor: pointer;
  }
</style>
